;
(function() {

	module.exports = {
		prefix: "/user/ticket",
		get: {
			"/list": function() {
				var user = role.getUser(this);
				var query = this.request.query;
				var ticket_list = user.getTicketList(query.state);
				this.body = ResponObj("json", ticket_list);
			},
			"/list/for_ach_id/:ach_id": function() {
				var user = role.getUser(this);
				var ach_id = this.params.ach_id;
				var ticket_list = user.getUseAbleTickListForAch(ach_id)
				this.body = ResponObj("json", ticket_list);
			},
			"/by_id/:ticket_id": function() {
				var user = role.getUser(this);
				var ticket_id = this.params.ticket_id;
				var ticket = user._getTicket(ticket_id);
				this.body = ResponObj("json", ticket);
			}
		},
		post: {
			"/add_ticket_from_ticket_factory/:ticket_factory_id": function() {
				var user = role.getUser(this);
				var ticket_factory_id = this.params.ticket_factory_id;
				var ticket = user.addTicketFromTicketFactory(ticket_factory_id);
				this.body = ResponObj("json", ticket);
			}
		}
	}
	var role = require("./role");
	var BusCon = require("../../core/bus/_con");
	var UserCon = require("../../core/user/_con");
	var GoodsCon = require("../../core/goods/_con");
	var AchCon = require("../../core/ach/_con");
	var db = require("../../core/db/index");
	var config = require("../../core/_include/config");
	var ResponObj = require("../_include/responObj");
}());